package models

type News struct {
	TimedModel
	Title     string `gorm:"not null;" json:"title"`
	NewsImg   string `gorm:"" json:"newsImg"`
	Label     string `gorm:"type:enum('military','science','game','pastime','health','car');not null;" json:"label"`
	UserId    string `gorm:"not null;" json:"userId"`
	Username  string `gorm:"not null;" json:"username"`
	State     string `gorm:"type:enum('released','audit','deleted','hold');not null;default:'hold';" json:"state"`
	Url       string `gorm:"not null;" json:"url"`
	Desc      string `gorm:"type:text" json:"desc"`
	Content   string `gorm:"not null;type:text" json:"content"`
	ReadCount int    `gorm:"" json:"readCount"`
}

func (News) TableName() string {
	return "t_news"
}
